#include "Init.h"

extern "C" __declspec(dllexport) IrrlichtDevice* CreateNewInstance(unsigned int deviceType, unsigned int width, unsigned int height,
	unsigned int bits, bool fullscreen, bool stencilBuffer, bool vSync)
{
	video::E_DRIVER_TYPE type;
	switch(deviceType)
	{
	case 0:
		type = video::EDT_NULL;
		break;
	case 1:
		type = video::EDT_SOFTWARE;
		break;
	case 2:
		type = video::EDT_BURNINGSVIDEO;
		break;
	case 3:
		type = video::EDT_DIRECT3D8;
		break;
	case 4:
		type = video::EDT_DIRECT3D9;
		break;
	case 5:
		type = video::EDT_OPENGL;
		break;
	case 6:
		type = video::EDT_COUNT;
		break;
	}

	IrrlichtDevice *device = createDevice(type, dimension2d<u32>(width, height), bits, fullscreen, stencilBuffer, vSync, 0);
	return device;
}